home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-09-22 | 50.7 KB | 1,027 lines |
- (*----------------------------------------------------------------------*)
- (* GLOBAL VARIABLE DEFINITIONS *)
- (*----------------------------------------------------------------------*)
-
- CONST
- (* 8086/8088 hardware flags *)
-
- Carry_Flag = 1;
- Parity_Flag = 4;
- Aux_Carry_Flag = 16;
- Zero_Flag = 64;
- Sign_Flag = 128;
-
- TYPE
-
- AnyStr = STRING[255] (* Matches any string for parameter passing *);
-
- StringPtr = ^AnyStr (* Points to a string *);
-
- ShortStr = STRING[30] (* Short string *);
-
- String1 = STRING[1] (* 1-character string *);
-
- String10 = STRING[10] (* 10-character string *);
-
- String12 = STRING[12] (* 12-character string *);
-
- KeyStr = STRING[65] (* Function key string *);
-
- KeyStrPtr = ^KeyStr (* Points to function key string *);
-
- FileStr = STRING[65] (* File name string *);
-
- RegPack = RECORD (* 8086/8088 registers *)
- CASE INTEGER OF
- 1: ( Ax, Bx, Cx, Dx, Bp, Si, Di, Ds, Es, Flags : INTEGER );
- 2: ( Al, Ah, Bl, Bh, Cl, Ch, Dl, Dh : BYTE );
- END;
-
- Text_File = TEXT [512] (* General text file *);
-
- (* Comparison types for string tests *)
-
- Comparer = ( Less, Equal, Greater );
-
- (* Character set definitions *)
- CharSet = SET OF CHAR;
-
- (*----------------------------------------------------------------------*)
- (* ASCII character set definitions *)
- (*----------------------------------------------------------------------*)
-
- CONST
-
- NUL = 0 (* NULL *);
- ETX = 3 (* ETX = ^C *);
- ENQ = 5 (* ENQ = Enquiry *);
- BELL = 7 (* BELL = bell *);
- BS = 8 (* Backspace *);
- HT = 9 (* Horizontal Tab *);
- LF = 10 (* Line Feed *);
- VT = 11 (* Vertical Tab *);
- FF = 12 (* Form Feed *);
- CR = 13 (* Carriage Return *);
- SO = 14 (* Start grahics *);
- SI = 15 (* End graphics *);
- DLE = 16 (* Data link esc. *);
- XON = 17 (* XON *);
- XOFF = 19 (* XOFF *);
- SUB = 26 (* End of file *);
- ESC = 27 (* Escape *);
- FS = 28 (* Graphics start *);
- GS = 29 (* Graphics start *);
- RS = 30 (* Inc. plot start *);
- US = 31 (* Graphics end *);
- SP = 32 (* Space *);
- DEL = 127 (* Delete *);
-
- (*----------------------------------------------------------------------*)
- (* Copyright notice *)
- (*----------------------------------------------------------------------*)
-
- (* STRUCTURED *) CONST
- CopyRight_Notice : STRING[47] = 'Copyright (c) 1985,1986,1987 by Philip R. Burns';
-
- (*----------------------------------------------------------------------*)
- (* Program version *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Pibterm_Version : KeyStr (* Version of PibTerm *);
- Pibterm_Date : KeyStr (* Date of PibTerm version *);
- Test_Version : BOOLEAN (* If a test version *);
-
- (*----------------------------------------------------------------------*)
- (* Command Line Parameters *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Command_Script_File_Name : FileStr;
- Command_Config_File_Name : FileStr;
- Command_Dialing_File_Name : FileStr;
- Command_Prefix_File_Name : FileStr;
- Command_Translate_File_Name: FileStr;
- Command_Function_Key_Name : FileStr;
- Command_Log_File_Name : FileStr;
- Command_Debug_Mode : BOOLEAN;
-
- (*----------------------------------------------------------------------*)
- (* PibTerm Command Types *)
- (*----------------------------------------------------------------------*)
-
- CONST
- No_Of_PibTerm_Commands = 109;
- No_Of_Pibterm_Commands_Minus_One = 108;
-
- TYPE
- PibTerm_Command_Type =
- ( AddCommandSy, AddLFSy, AlarmSy, AreaCodeSy,
- BreakSy, CallSy, CaptureSy, CaseSy,
- ChDirSy, ClearSy, CloseSy, ClrEolSy,
- CommFlushSy, DeclareSy, DelaySy, DelLineSy,
- DialSy, DoCaseSy, DosSy, EchoSy,
- EditSy, ElseSy, ElseIfSy, EndCaseSy,
- EndDoCaseSy, EndForSy, EndIfSy, EndProcSy,
- EndWhileSy, ExecuteSy, ExeNewSy, ExitSy,
- ExitAllSy, FastCSy, FileSy, ForSy,
- GetDirSy,
- GetParamSy, GetVarSy, GossipSy, GoToSy,
- GoToXYSy, HangUpSy, HostSy, IfConSy,
- IfDialSy, IfEofSy, IfExistsSy, IfFoundSy,
- IfLocStrSy, IfOkSy, IfOpSy, IfRemStrSy,
- ImportSy, InfoSy, InputSy, InsLineSy,
- KeyDefSy, KeyFlushSy, KeySendSy, KeySy,
- LabelSy, LogSy, MenuSy, MessageSy,
- MuteSy, OpenSy, ParamSy, PImportSy,
- ProcedureSy, QuitSy, ReadSy, ReadLnSy,
- ReceiveSy, ReDialSy, RepeatSy, ResetSy,
- ReturnSy, RInputSy, ScriptSy, SDumpSy,
- SendSy, SetSy, SetParamSy, SetVarSy,
- STextSy, SuspendSy, TextSy, TimersSy,
- TranslateSy, UntilSy, ViewSy, WaitSy,
- WaitCountSy, WaitListSy, WaitQuietSy, WaitStrSy,
- WaitTimeSy, WhenSy, WhenDropSy, WhenListSy,
- WhereXYSy, WhileSy, WriteSy, WriteLnSy,
- WriteLogSy, ZapVarSy, Bad_Command, Null_Command
- );
-
- (* Command to be executed *)
- VAR
- PibTerm_Command : PibTerm_Command_Type;
-
- (* Conversion table from input to *)
- (* commands. *)
- VAR
- PibTerm_Command_Table : ARRAY[0..255] OF PibTerm_Command_Type;
-
- (*----------------------------------------------------------------------*)
- (* Timing constants and variables *)
- (*----------------------------------------------------------------------*)
-
- TYPE
- Date_Format_Type = ( MDY_Style, YMD_Style, DMY_Style );
- Time_Format_Type = ( Military_Time, AMPM_Time );
-
- CONST
- Half_Second_Delay = 500 (* Delay argument for 1/2 sec. delay *);
- One_Second_Delay = 1000 (* Delay argument for 1 second delay *);
- Two_Second_Delay = 2000 (* Delay argument for 2 second delay *);
- Three_Second_Delay = 3000 (* Delay argument for 3 second delay *);
- Tenth_of_a_second_Delay = 100 (* 1/10 second delay *);
-
- VAR
- Delay_Time : INTEGER;(* Time to delay in response to DELAY *)
- (* command *)
- Break_Length : INTEGER (* Length of line break in 1/10 secs *);
-
- Current_Status_Time : INTEGER (* Current time for status line *);
- New_Status_Time : INTEGER (* Updated time for status line *);
- Time_Format : Time_Format_Type (* Time format *);
- Date_Format : Date_Format_Type (* Date format *);
-
- (*----------------------------------------------------------------------*)
- (* Text/Menu Colors *)
- (*----------------------------------------------------------------------*)
-
- VAR
- ForeGround_Color : INTEGER (* Color for ordinary text *);
- BackGround_Color : INTEGER (* Usual background color *);
- Border_Color : INTEGER (* Usual border color *);
-
- Menu_Text_Color : INTEGER (* Color for menu text *);
- Menu_Title_Color : INTEGER (* Color for menu titles *);
- Menu_Frame_Color : INTEGER (* Color for menu frame *);
- Menu_Text_Color_2: INTEGER (* Secondary color for menu text *);
- Text_Mode : INTEGER (* Text mode for all text *);
-
- (*----------------------------------------------------------------------*)
- (* Status line colors *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Status_Line_Attr : INTEGER (* Color attribute for status line *);
- Status_ForeGround_Color : INTEGER (* Text color for status line *);
- Status_BackGround_Color : INTEGER (* Background color for status line*);
- Reverse_Status_Colors : BOOLEAN (* TRUE to use inverse term colors *);
-
- (*----------------------------------------------------------------------*)
- (* VT100 emulation colors *)
- (*----------------------------------------------------------------------*)
-
- VAR
- VT100_ForeGround_Color : INTEGER (* VT100 foreground color *);
- VT100_BackGround_Color : INTEGER (* VT100 background color *);
- VT100_Border_Color : INTEGER (* VT100 border color *);
- VT100_Underline_Color : INTEGER (* VT100 foreground color *);
- VT100_Bold_Color : INTEGER (* VT100 background color *);
-
- (*----------------------------------------------------------------------*)
- (* Graphics emulation colors *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Graphics_ForeGround_Color : INTEGER (* Graphics mode foreground color *);
- Graphics_BackGround_Color : INTEGER (* Graphics mode background color *);
-
- (*----------------------------------------------------------------------*)
- (* Program Option Flags *)
- (*----------------------------------------------------------------------*)
-
- CONST
- ON = TRUE (* Convenient synonym for switches *);
- OFF = FALSE (* Likewise *);
-
- VAR
- Local_Echo : BOOLEAN (* Local Echo ON/OFF *);
- BS_Char : CHAR (* CHAR to send when Back Space hit *);
- Ctrl_BS_Char : CHAR (* CHAR to send when CTRL BS hit *);
- Silent_Mode : BOOLEAN (* TRUE to suppress bells, music. *);
- Printer_On : BOOLEAN (* Echo to printer *);
- Capture_On : BOOLEAN (* Capture mode on *);
- Exact_Capture : BOOLEAN (* TRUE for exact capture mode *);
- Translate_On : BOOLEAN (* Translate mode on *);
- Add_LF : BOOLEAN (* Add line feeds to incoming lines *);
- Play_Music_On : BOOLEAN (* Play music if found *);
- Pibterm_Done : BOOLEAN (* Finished running PibTerm *);
- Gossip_Mode_On : BOOLEAN (* Split-screen gossip mode *);
- Reset_Comm_Port : BOOLEAN (* TRUE to reset comm port *);
- Comm_Port_Changed : BOOLEAN (* TRUE if comm port number changed *);
- Host_Mode : BOOLEAN (* TRUE if PibTerm in host mode *);
- Last_Column_Hit : BOOLEAN (* TRUE if col 80 hit in display *);
- Auto_Wrap_Mode : BOOLEAN (* TRUE for autowrap on long lines *);
- Exploding_Menus : BOOLEAN (* TRUE to use exploding menus *);
- Review_On : BOOLEAN (* TRUE if review buffer used *);
- Script_File_Mode : BOOLEAN (* TRUE if currently exec'ing script *);
- Script_Learn_Mode : BOOLEAN (* TRUE if currently learning script *);
- CompuServe_B_On : BOOLEAN (* CompuServe B protocol in VT52 *);
- Mahoney_On : BOOLEAN (* Mahoney BBS codes allowed *);
- When_Mode : BOOLEAN (* TRUE if WHEN string defined *);
- When_Drop_Mode : BOOLEAN (* TRUE if WHENDROP in effect *);
- WaitQuiet_Mode : BOOLEAN (* TRUE if WAITQUIET in effect *);
- WaitCount_Mode : BOOLEAN (* TRUE if WAITCOUNT in effect *);
- WaitString_Mode : BOOLEAN (* TRUE if WAITSTRING string defined *);
- Read_In_Script : BOOLEAN (* TRUE to read in script *);
- Really_Wait_String : BOOLEAN (* TRUE to really wait for string *);
- Write_Screen_Memory : BOOLEAN (* TRUE to write video memory direct *);
- Write_Screen_Memory_Par : BOOLEAN (* TRUE to write video direct -- param *);
- Alter_Baud_Rate : BOOLEAN (* TRUE to get baud rate from modem *);
- Check_CTS : BOOLEAN (* TRUE to check clear-to-send line *);
- Check_DSR : BOOLEAN (* TRUE to check data-set-ready line *);
- Hard_Wired : BOOLEAN (* TRUE if hard-wired connection *);
- Drop_Dtr_At_End : BOOLEAN (* TRUE to drop DTR when closing port*);
- Close_Comm_For_Dos : BOOLEAN (* TRUE to drop DTR when Alt-J done *);
- Wait_For_Retrace : BOOLEAN (* TRUE to wait for retrace in DSW *);
- Wait_For_Retrace_Par: BOOLEAN (* TRUE to wait for retrace -- param *);
- Show_Status_Line : BOOLEAN (* TRUE to display line 25 status *);
- Show_Status_Time : BOOLEAN (* TRUE to display time on line 25 *);
- Do_Status_Time : BOOLEAN (* TRUE to show time on status line *);
- Save_Do_Status_Time : BOOLEAN (* Saves status time check *);
- Do_Status_Line : BOOLEAN (* TRUE to show status line *);
- Do_Xon_Xoff_Checks : BOOLEAN (* TRUE to use xon/xoff flow control *);
- Evict_Partial_Trans : BOOLEAN (* TRUE to throw away bad downloads *);
- Use_Dos_Exec_In_Jump: BOOLEAN (* TRUE to use DOS EXEC when jumping *)
- (* to DOS *);
- Use_Ymodem_Header : BOOLEAN (* Send block 0 in Ymodem non-batch *);
- Use_Block_Zero : BOOLEAN (* Use block 0 info when received *);
- Extended_Keypad : BOOLEAN (* Allow extended keypad keys *);
- Attended_Mode : BOOLEAN (* TRUE if running attended *);
- Edit_Insert_Mode : BOOLEAN (* TRUE if insert mode by default *);
- Auto_Load_FunKeys : BOOLEAN (* TRUE to autoload function keys *);
- Use_Dos_Buffer_In : BOOLEAN (* TRUE to use DOS function $A *);
- YTerm_On : BOOLEAN (* TRUE if YTerm transfers allowed *);
- Debug_Mode : BOOLEAN (* TRUE if Debug mode on *);
- Use_Dos_Con_Output : BOOLEAN (* TRUE to use DOS console writes *);
- Auto_Unload_Scripts : BOOLEAN (* TRUE to auto unload scripts *);
- Do_Script_Tests : BOOLEAN (* TRUE to do script-related checks *);
- Use_EMM_For_Overlays: BOOLEAN (* TRUE to put overlays in EMM *);
- Keyboard_Locked : BOOLEAN (* TRUE if keyboard locked *);
- Auto_Find_FileNames : BOOLEAN (* TRUE to find file names in trans. *);
- Rlink_Prompt_Each : BOOLEAN (* TRUE to prompt each file, Rlink *);
- Graphics_Terminal_Mode : BOOLEAN (* TRUE if graphics terminal *);
- EGA_Present : BOOLEAN (* TRUE if EGA installed *);
- ATI_Ega_Wonder : BOOLEAN (* If ATI Wonder EGA installed *);
- Cursor_Underline : BOOLEAN (* TRUE = underline cursor *);
- Cursor_Blink : BOOLEAN (* TRUE if cursor blinks *);
- Auto_Strip_High_Bit : BOOLEAN (* TRUE to strip high bit in term. *);
- Software_Scroll : BOOLEAN (* TRUE to use software scrolling. *);
- Software_Scroll_Par : BOOLEAN (* TRUE to use software scrolling. *);
-
- Current_Carrier_Status : BOOLEAN (* Has current carrier detect status*);
- New_Carrier_Status : BOOLEAN (* Has new carrier detect status *);
- Carrier_Dropped : BOOLEAN (* TRUE if carrier dropped *);
- Video_Handler_Installed: BOOLEAN (* TRUE if new int $10 handler inst.*);
- Send_Upper_Case_Only : BOOLEAN (* TRUE to send upper case only *);
- Log_File_Open : BOOLEAN (* TRUE if log file open *);
- Logging_On : BOOLEAN (* TRUE to write to log *);
-
- (*----------------------------------------------------------------------*)
- (* Global files *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Capture_File : Text_File (* Capture file *);
- Script_File : Text_File (* Script file *);
- Log_File : Text_File (* Log file for host mode *);
-
- Capture_File_Name : FileStr (* Capture file name *);
- Config_File_Name : FileStr (* Configuration file name *);
- Dialing_File_Name : FileStr (* Dialing directory file name *);
- Function_Key_Name : FileStr (* Function key file name *);
- Translate_File_Name : FileStr (* Translate table file name *);
- Prefix_File_Name : FileStr (* Dialing prefix file name *);
- Log_File_Name : FileStr (* Log file name *);
-
- Home_Dir_Path : FileStr (* Home Directory Path for PibTerm *);
- Home_Dir : FileStr (* Home Directory for PibTerm *);
- Home_Drive : CHAR (* Home Drive Letter for PibTerm *);
- Download_Dir_Path : FileStr (* Download directory name *);
- Upload_Dir_Path : FileStr (* Upload directory name *);
- Script_Path : FileStr (* Script path *);
- Function_Key_Path : FileStr (* Function key path *);
-
- Screen_Dump_Name : FileStr (* Screen dump file name *);
- Graphics_Dump_Name: FileStr (* Graphics mode screen dump name *);
- Script_File_Name : FileStr (* Script file name *);
- Saved_Script_File_Name : FileStr(* Saved script file name *);
- Editor_Name : FileStr (* Path for editor *);
- Browser_Name : FileStr (* Path for file browser *);
-
- (*----------------------------------------------------------------------*)
- (* Host mode globals *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Privilege : CHAR (* Host mode privilege level *);
- Host_Mode_Upload : FileStr (* Upload path for host mode *);
- Host_Mode_Download : FileStr (* Download path for host mode *);
- Host_Mode_Blank_Time: REAL (* Time after which to blank screen *);
- Host_CTTY_Device : STRING[8] (* CTTY Device driver name prefix *);
-
- (*----------------------------------------------------------------------*)
- (* Spooled print file *)
- (*----------------------------------------------------------------------*)
-
- CONST
- Max_Spool_Buffer_Count = 512;
-
- TYPE
- Spool_File_Buffer_Type = ARRAY[1..Max_Spool_Buffer_Count] OF CHAR;
- Spool_File_Buffer_Ptr = ^Spool_File_Buffer_Type;
-
- VAR
- Spool_File_Handle : INTEGER (* File handle for spooling file *);
- Spool_Buffer_Count : INTEGER (* Characters in current buffer *);
- Spool_Buffer_Pos : INTEGER (* Offset of current char in buffer *);
- Spool_Buffer : Spool_File_Buffer_Ptr (* Spooling buffer *);
- Print_Spooling : BOOLEAN (* TRUE if file being printed *);
- Printer_Setup : AnyStr (* Printer setup string *);
-
- (*----------------------------------------------------------------------*)
- (* Review buffer *)
- (*----------------------------------------------------------------------*)
-
- CONST
- Max_Review_Line_Length = 253 (* Maximum chars in each review line *);
-
- TYPE
- Review_Buffer_Type = ARRAY[1..1] OF CHAR;
- Review_Buffer_Ptr = ^Review_Buffer_Type;
-
- VAR
- Max_Review_Length : INTEGER (* Number of chars in review buffer *);
-
- (* Review buffer pointer *)
- Review_Buffer : Review_Buffer_Ptr;
-
- Review_Line : AnyStr (* Current line *);
- Review_Head : INTEGER (* Head of review buffer *);
- Review_Tail : INTEGER (* Tail of review buffer *);
-
- (*----------------------------------------------------------------------*)
- (* Definitions for keyboard interrupt handling *)
- (*----------------------------------------------------------------------*)
-
- CONST
- Kbd_Interrupt = 9 (* Keyboard interrupt number *);
- Kbd_ROM_Data = $0040 (* Segment with keyboard data *);
- Kbd_Flag = $0017 (* Byte 1 of keyboard status *);
- Kbd_Flag1 = $0018 (* Byte 2 of keyboard status *);
- Kbd_Head = $001A (* Buffer head pointer *);
- Kbd_Tail = $001C (* Buffer tail pointer *);
- Kbd_Buffer = $001E (* Default buffer location *);
- Kbd_Buffer_End = $003E (* End of default buffer *);
-
- CONST (* Save previous keyboard interrupt status *)
- (* Note: THESE MUST BE IN CODE SEGMENT! *)
- Kbd_Save_Iaddr2 : INTEGER = 0;
- Kbd_Save_Iaddr1 : INTEGER = 0;
-
- (*----------------------------------------------------------------------*)
- (* PibTerm Command Key Definitions *)
- (*----------------------------------------------------------------------*)
-
- CONST
- No_Misc_Keys = 5;
-
- CONST
- Alt_A = 30; Alt_J = 36; Alt_S = 31;
- Alt_B = 48; Alt_K = 37; Alt_T = 20;
- Alt_C = 46; Alt_L = 38; Alt_U = 22;
- Alt_D = 32; Alt_M = 50; Alt_V = 47;
- Alt_E = 18; Alt_N = 49; Alt_W = 17;
- Alt_F = 33; Alt_O = 24; Alt_X = 45;
- Alt_G = 34; Alt_P = 25; Alt_Y = 21;
- Alt_H = 35; Alt_Q = 16; Alt_Z = 44;
- Alt_I = 23; Alt_R = 19;
-
- Alt_1 = 120; Alt_5 = 124; Alt_9 = 128;
- Alt_2 = 121; Alt_6 = 125; Alt_0 = 129;
- Alt_3 = 122; Alt_7 = 126; Alt_Minus = 130;
- Alt_4 = 123; Alt_8 = 127; Alt_Equal = 131;
-
- Shift_Tab = 15; Ctrl_Tab = 151; Alt_Tab = 172;
-
- F1 = 59; Alt_F1 = 104;
- F2 = 60; Alt_F2 = 105;
- F3 = 61; Alt_F3 = 106;
- F4 = 62; Alt_F4 = 107;
- F5 = 63; Alt_F5 = 108;
- F6 = 64; Alt_F6 = 109;
- F7 = 65; Alt_F7 = 110;
- F8 = 66; Alt_F8 = 111;
- F9 = 67; Alt_F9 = 112;
- F10 = 68; Alt_F10 = 113;
- Shift_F1 = 84; Ctrl_F1 = 94;
- Shift_F10 = 93; Ctrl_F10 = 103;
-
- U_Arrow = 72; Alt_U_Arrow = 175; Ctrl_U_Arrow = 160;
- D_Arrow = 80; Alt_D_Arrow = 183; Ctrl_D_Arrow = 164;
- L_Arrow = 75; Alt_L_Arrow = 178; Ctrl_L_Arrow = 115;
- R_Arrow = 77; Alt_R_Arrow = 180; Ctrl_R_Arrow = 116;
-
- Home = 71; Alt_Home = 174; Ctrl_Home = 119;
- End_Key = 79; Alt_End_Key = 182; Ctrl_End_Key = 117;
- PgUp = 73; Alt_PgUp = 176; Ctrl_PgUp = 132;
- PgDn = 81; Alt_PgDn = 184; Ctrl_PgDn = 118;
- Ins_Key = 82; Alt_Ins_Key = 185; Ctrl_Ins_Key = 165;
- Del_Key = 83; Alt_Del_Key = 186; Ctrl_Del_Key = 166;
- Kpd_Minus = 74; Alt_Kpd_Minus = 177; Ctrl_Kpd_Minus = 161;
- Kpd_Plus = 78; Alt_Kpd_Plus = 181; Ctrl_Kpd_Plus = 163;
- Kpd_5 = 76; Alt_Kpd_5 = 179; Ctrl_Kpd_5 = 162;
-
- Alt_Enter = 28; Alt_BS = 171;
-
- PrtSc = 255;
- Ctrl_PrtSc = 114;
- Alt_PrtSc = 55;
-
- VAR
- Funk_Bases: ARRAY[1..4] OF BYTE (* Function key scan code bases *);
- Keypad_Nos: ARRAY[0..12] OF BYTE (* Keypad indices *);
- Number_Nos: ARRAY[0..12] OF BYTE (* Alt-# indices *);
- Ctrl_Keys : ARRAY[0..12] OF BYTE (* Ctrl-keypad indices *);
- Misc_Keys : ARRAY[1..No_Misc_Keys] OF BYTE (* Miscellaneous indices*);
-
- (*----------------------------------------------------------------------*)
- (* Auxilliary keyboard buffers *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Keyboard_Buffer : AnyStr (* Holds program generated input *);
- Keyboard_Line : AnyStr (* Holds manually generated input *);
- Keyboard_Line_Pos : INTEGER (* Position in keyboard line *);
-
- (* Command-key definitions *)
- VAR
- Alt_Let_Set : SET OF BYTE;
-
- (*----------------------------------------------------------------------*)
- (* Incoming/Outgoing key definitions *)
- (*----------------------------------------------------------------------*)
-
- TYPE
- Key_Record = RECORD
- Def : KeyStrPtr;
- Name : STRING[3];
- END;
-
- VAR
- (* Key strings *)
-
- Key_Definitions : ARRAY[0..255] OF Key_Record;
-
- (* Maps input key to Keypad/Number *)
-
- Keypad_Key_Index : ARRAY[0..255] OF BYTE;
-
- Key_No : INTEGER (* Key number to execute *);
-
- FK_CR : CHAR (* Function key definition CR *);
- FK_Delay : CHAR (* Function key def. 1 second wait *);
- FK_Wait_For : CHAR (* Function key wait for next char *);
- FK_Ctrl_Mark : CHAR (* Marks next char as ctrl character *);
- FK_Script_Ch : CHAR (* Script to execute follows *);
- FK_Delay_Time: INTEGER (* Delay to insert between each char *);
-
- (* Incoming character translate table *)
-
- TrTab : ARRAY[CHAR] OF CHAR;
-
- (*----------------------------------------------------------------------*)
- (* Global communications variables *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Data_Bits : 5..8;
- Parity : CHAR;
- Stop_Bits : 0..2;
- Comm_Port : 1..4;
- Baud_Rate : 110..19200;
-
- (*----------------------------------------------------------------------*)
- (* Global variables for view file/directory/area codes *)
- (*----------------------------------------------------------------------*)
-
- VAR
- View_Count : INTEGER;
- View_Line : STRING[128];
- View_Done : BOOLEAN;
- View_Char : STRING[1];
- View_Y : INTEGER;
-
- (*----------------------------------------------------------------------*)
- (* Types and Variables for Terminal Emulation Facilities *)
- (*----------------------------------------------------------------------*)
-
- CONST
- NumberTerminalTypes = 14 (* # terminal types - 1 *);
- Actual_N_Of_Terminals = 15 (* # terminal types implemented *);
- Max_User_Terminals = 5 (* # user terminals allowed *);
-
- TYPE
- Terminal_Type = ( Dumb, VT52, Ansi, VT100, Gossip,
- HostMode, TEK4010, ADM3a, ADM5, TV925,
- User1, User2, User3, User4, User5 );
-
- VAR
- (* Type of terminal to emulate *)
- Terminal_To_Emulate : Terminal_Type;
-
- (* Saves previous term. type *)
- Saved_Gossip_Term : Terminal_Type;
-
- (* List of terminals to emulate *)
-
- Terminal_Type_List : ARRAY[0..NumberTerminalTypes] OF Terminal_Type;
-
- (* Terminal names *)
-
- Terminal_Name_List : ARRAY[0..NumberTerminalTypes] OF STRING[7];
-
- (* Names for status line *)
- VAR
- Status_Line_Name : STRING[132];
- Short_Terminal_Name : STRING[20];
-
- VAR (* VT100 answerback message *)
-
- VT100_Answerback_Message : STRING[20];
-
- (* Remember cursor/attributes *)
- Save_Row_Position : INTEGER (* Save row position *);
- Save_Col_Position : INTEGER (* Save column position *);
- Save_BG_Color : INTEGER (* Save background color *);
- Save_FG_Color : INTEGER (* Save foreground color *);
- Save_Graphics_Mode : BOOLEAN (* Save graphics mode *);
- Save_Bolding : BOOLEAN (* Save bolding mode *);
- Save_Blinking : BOOLEAN (* Save blinking mode *);
- Save_Done : BOOLEAN (* If save actually done *);
- Save_Origin_Mode : BOOLEAN (* Save origin mode setting *);
- Save_Top_Scroll : INTEGER (* Save top line in scrolling reg. *);
- Save_Bottom_Scroll : INTEGER (* Save bottom line in scroll reg. *);
-
- Ansi_ForeGround_Color : INTEGER (* Global foreground color here *);
- Ansi_BackGround_Color : INTEGER (* Global background color here *);
- Ansi_Underline_Color : INTEGER (* Color for underlines *);
- Ansi_Bold_Color : INTEGER (* Color for bolding *);
-
- FG : INTEGER (* Foreground color *);
- BG : INTEGER (* Background color *);
-
- Save_Global_FG : INTEGER (* Save global foreground color *);
- Save_Global_BG : INTEGER (* Save global background color *);
- Save_FG : INTEGER (* Save foreground color *);
- Save_BG : INTEGER (* Save background color *);
- Save_EG : INTEGER (* Save border color *);
- Save_FG1 : INTEGER (* Save foreground color *);
- Save_BG1 : INTEGER (* Save background color *);
-
- (* General emulation variables *)
- VAR
- Graphics_Mode : BOOLEAN (* TRUE if graphics mode on *);
- Alt_KeyPad_Mode : BOOLEAN (* TRUE if alternate keypad in use *);
- Hold_Screen_Mode : BOOLEAN (* TRUE if in hold screen mode *);
- Reset_Requested : BOOLEAN (* TRUE to reset terminal *);
- Auto_Print_Mode : BOOLEAN (* IF auto print mode in effect *);
- Printer_Ctrl_Mode : BOOLEAN (* IF printer controller mode on *);
- Insertion_Mode : BOOLEAN (* If insertion mode on *);
- Double_Width_Mode : BOOLEAN (* Double width characters *);
- Skip_All_Mode : BOOLEAN (* Skip all chars in line *);
- Bolding_On : BOOLEAN (* TRUE if bolding on *);
- Blinking_On : BOOLEAN (* TRUE if blinking on *);
- Reverse_On : BOOLEAN (* TRUE if reverse video on *);
- Width_132 : BOOLEAN (* TRUE if 132 column mode *);
- New_Line : BOOLEAN (* TRUE if LF -> CR +LF *);
- Getting_Music : BOOLEAN (* TRUE if getting music *);
- Origin_Mode : BOOLEAN (* TRUE for region origin mode *);
- Auto_Change_Arrows : BOOLEAN (* TRUE to handle cursor key mode *)
- (* changes in VT100 emulation. *);
-
- (* Escape mode processing *)
- VAR
- Escape_Mode : BOOLEAN (* If processing escape sequence *);
- Escape_Number : INTEGER (* # of numeric parms in esc seq. *);
-
- (* Holds numeric parms in esc seq *)
- Escape_Register : ARRAY[1..100] OF BYTE;
- Escape_Str : AnyStr (* Collects string arg in esc seq *);
- Escape_Type : CHAR (* Type of escape seq. being done *);
- Reg_Val : INTEGER (* General utility register value *);
-
- (* Attributes for each line *)
-
- Line_Attributes : ARRAY[1..100] OF BYTE;
-
- (* Save current scrolling region *)
- Top_Scroll : INTEGER;
- Bottom_Scroll : INTEGER;
-
- Ansi_Last_Line : INTEGER (* Last line in display *);
-
- (* LED status in VT100 *)
-
- VT100_Led_Vector : ARRAY[1..4] OF BOOLEAN;
-
- VAR (* Names of user-defined terminals *)
-
- User_Term_Name : ARRAY[1..Max_User_Terminals] OF FileStr;
-
- (*--------------------------------------------------------------------------*)
- (* Display action type definitions *)
- (*--------------------------------------------------------------------------*)
-
- (*--------------------------------------------------------------------------*)
- (* CursorUp --- Move cursor up one line *)
- (* CursorDown --- Move cursor down one line *)
- (* CursorLeft --- Move cursor left one column *)
- (* CursorRight --- Move cursor right one column *)
- (* ClearScreen --- Clear entire screen *)
- (* ClearEOS --- Clear to end of screen from current position *)
- (* ClearSCur --- Clear from start of screen to current position *)
- (* ClearLine --- Clear entire line *)
- (* ClearEOL --- Clear to end of line *)
- (* ClearLCur --- Clear start of line to current position *)
- (* CursorHome --- Home the cursor *)
- (* InsertCharA --- Insert a character after current position *)
- (* InsertCharB --- Insert a character before current position *)
- (* InsertLineA --- Insert line after current line *)
- (* InsertLineB --- Insert line before current line *)
- (* DeleteChar --- Delete character at current position *)
- (* DeleteLine --- Delete current line *)
- (* StartInsert --- Enter character insertion mode *)
- (* EndInsert --- Exit character insertion mode *)
- (* NormalVideo --- Enter normal video mode *)
- (* ReverseVideo --- Enter reverse video mode *)
- (* StartBlink --- Start blink mode *)
- (* EndBlink --- End blink mode *)
- (* StartUnderline --- Start underline mode *)
- (* EndUnderline --- End underline mode *)
- (* StartBold --- Start bold mode *)
- (* EndBold --- End bold mode *)
- (* ReverseIndex --- Reverse line feed *)
- (* PrintLine --- Print current line *)
- (* PrintPage --- Print whole screen *)
- (* CursorPos --- Position cursor *)
- (* StartAltKey --- Enter alternate keypad mode *)
- (* EndAltKey --- End alternate keypad mode *)
- (* StartAutoPrint --- Start autoprint mode *)
- (* EndAutoPrint --- End autoprint mode *)
- (* SetTab --- Set tab stop *)
- (* ClearTab --- Clear tab stop *)
- (* StartDim --- Start dim mode *)
- (* EndDim --- End dim mode *)
- (*--------------------------------------------------------------------------*)
-
-
- TYPE
- Display_Action = ( CursorUp, CursorDown, CursorLeft, CursorRight,
- ClearScr, ClearScrH, ClearEOS, ClearSCur,
- ClearLine,
- ClearEOL, ClearLCur, CursorHome, InsertCharA,
- InsertCharB, InsertLineA, InsertLineB, DeleteChar,
- DeleteLine, StartInsert, EndInsert, NormalVideo,
- ReverseVideo, StartBlink, EndBlink, StartUnderline,
- EndUnderline, StartBold, EndBold,
- StartDim, EndDim, ReverseIndex,
- PrintLine, PrintPage, CursorPosVT52, StartAltKey,
- EndAltKey, StartAutoPrint, EndAutoPrint, SetTab,
- ClearTab, DisplayChar, StartPrintControl,
- EndPrintControl, IdentifyVT52,
- StartGraphicsMode, EndGraphicsMode, TV950Video, Swallow,
- CursorPosH, CursorPosV,
- StartVT52HoldScreen, EndVT52HoldScreen,
- EnterVT100, EnterVT52,
- ExecPCCommands, SendMahoneyOn,
- EnterState1, EnterState2, EnterState3, EnterState4, EnterState5,
- Index, VT52HT, VT52LF
- );
-
- Display_Action_Vector_Type = ARRAY[CHAR] OF Display_Action;
- Display_Action_Vector_Ptr = ^Display_Action_Vector_Type;
-
- Display_Action_Chars_Type = ARRAY[1..1] OF CHAR;
- Display_Action_Actions_Type = ARRAY[1..1] OF Display_Action;
-
- Display_Action_Chars_Ptr = ^Display_Action_Chars_Type;
- Display_Action_Actions_Ptr = ^Display_Action_Actions_Type;
-
- Character_Vector_Type = ARRAY[CHAR] OF CHAR;
- Character_Vector_Ptr_Type = ^Character_Vector_Type;
-
- (*--------------------------------------------------------------------------*)
- (* Display action vectors *)
- (*--------------------------------------------------------------------------*)
-
- CONST
- MaxDisplayStates = 10;
- MaxDisplayCharSets = 5;
-
- TYPE
- Tab_Stop_Vector = ARRAY[1..132] OF BYTE;
-
- VAR
- Display_Action_Ptr : ARRAY[1..MaxDisplayStates] OF Display_Action_Vector_Ptr;
- Display_Action_State : 1..MaxDisplayStates;
-
- Display_Char_Set_Ptr : ARRAY[1..MaxDisplayCharSets] OF Character_Vector_Ptr_Type;
- Character_Set_Ptr : Character_Vector_Ptr_Type;
-
- (* Tab stuff *)
- VAR
- Number_Tab_Stops : INTEGER (* Number of tabs currently defined *);
-
- (* Tab positions *)
-
- Tab_Stops : Tab_Stop_Vector;
-
- (*----------------------------------------------------------------------*)
- (* Global variables for phone directory handling *)
- (*----------------------------------------------------------------------*)
-
- CONST
- Max_Phone_Prefixes = 5;
- Max_Dial_Nos = 10;
- Dialing_Dir_Entry_Length = 79;
-
- (* STRUCTURED *) CONST
- Phone_Prefix_Chars : ARRAY[ 1 .. Max_Phone_Prefixes ] OF CHAR
- = ( '+', '-', '!', '@', '#' );
-
- TYPE
-
- Char_25 = PACKED ARRAY[ 1 .. 25 ] OF CHAR;
- Char_15 = PACKED ARRAY[ 1 .. 15 ] OF CHAR;
- Char_9 = PACKED ARRAY[ 1 .. 9 ] OF CHAR;
- Char_8 = PACKED ARRAY[ 1 .. 8 ] OF CHAR;
- Char_5 = PACKED ARRAY[ 1 .. 5 ] OF CHAR;
- Char_2 = PACKED ARRAY[ 1 .. 2 ] OF CHAR;
-
- String30 = STRING[30];
-
- (* Dialing file entry *)
- Phone_Number_Record = RECORD
- Phone_Name : Char_25;
- Phone_Number : Char_15;
- Phone_Baud : Char_5;
- Phone_Parity : CHAR;
- Phone_DataBits : CHAR;
- Phone_StopBits : CHAR;
- Phone_Echo : CHAR;
- Phone_BackSpace : CHAR;
- Phone_LineFeed : CHAR;
- Phone_Term_Type : CHAR;
- Phone_Trans_Type : Char_2;
- Phone_Script : Char_9;
- Phone_Last_Date : Char_8;
- Phone_Last_Time : Char_8;
- END;
- (* Dialing directory *)
-
- Dialing_Directory_Type = ARRAY[1..1] OF Phone_Number_Record;
-
- Dialing_Directory_Ptr = ^Dialing_Directory_Type;
-
- Dialing_List_Record = RECORD
- Number: STRING[30];
- Tries : INTEGER;
- END;
-
- VAR
- (* Current phone entry data *)
-
- Phone_Entry_Data : Phone_Number_Record;
-
- (* Current phone record number *)
- Phone_Entry_Number : INTEGER;
- (* Current phone page number *)
- Phone_Entry_Page : INTEGER;
- (* Current phone section *)
- Dialing_Page : INTEGER;
- (* Phone prefix numbers *)
-
- Phone_Prefix_Nos : ARRAY[ 1 .. Max_Phone_Prefixes ] OF ShortStr;
-
- Default_Prefix : CHAR (* Default prefix character *);
- Default_Postfix : CHAR (* Default postfix character *);
- Phone_Number : String30 (* Phone number to dial *);
- Prefix_Str : ShortStr (* Phone number prefix *);
- Postfix_Str : ShortStr (* Phone number postfix *);
-
- N_Dial_Nos : INTEGER (* # of dial list entries *);
- I_Dial_Nos : INTEGER (* Current dial list entry *);
-
- (* Dialing list entries *)
-
- Dial_Nos : ARRAY[1..Max_Dial_Nos] OF Dialing_List_Record;
-
- (* Dialing directory size *)
- Dialing_Dir_Size : INTEGER;
- Dialing_Dir_Size_Max: INTEGER;
- (* Phone directory *)
-
- Dialing_Directory : Dialing_Directory_Ptr;
-
- Use_Short_Dial_Menu : BOOLEAN (* TRUE to use 1-line dial prompt *);
-
- Any_Dialing_Changes : BOOLEAN (* TRUE if any dialing entries changed *);
-
- Script_Dialed : BOOLEAN (* TRUE if doing linked script *);
-
- (*----------------------------------------------------------------------*)
- (* Global variables for modem *)
- (*----------------------------------------------------------------------*)
-
- VAR
- Modem_Init : AnyStr (* Modem initialization string *);
- Modem_Dial : ShortStr (* Modem dialing command *);
- Modem_Dial_End : ShortStr (* Modem end for dial command *);
- Modem_Busy : ShortStr (* Modem return if line busy *);
- Modem_Connect : ShortStr (* Modem connect message *);
- Modem_No_Carrier : ShortStr (* Modem no carrier message *);
- Modem_Escape : ShortStr (* Modem escape command *);
- Modem_Escape_Time : INTEGER (* Time in mil. for escape *);
- Modem_Hang_Up : ShortStr (* Modem hangup command *);
- Modem_Time_Out : REAL (* Modem time out value *);
- Modem_Redial_Delay : REAL (* Modem redial delay *);
- Modem_Answer : ShortStr (* Modem answer phone *);
- Modem_Host_Set : AnyStr (* Modem host mode setup *);
- Modem_Host_UnSet : AnyStr (* Modem host mode endup *);
- Modem_Command_Delay : INTEGER (* Ms between command chars *);
- Modem_Carrier_High : BOOLEAN (* TRUE if carrier line high *);
- Modem_Ring : ShortStr (* Modem ring detect message *);
- Host_Auto_Baud : BOOLEAN (* Attempt auto speed detect *);
-
- (*----------------------------------------------------------------------*)
- (* Global variables for file transfers *)
- (*----------------------------------------------------------------------*)
-
- CONST
- (* Special characters used in XMODEM *)
-
- SOH = $01; (* Start of XMODEM block *)
- STX = $02; (* Start of Ymodem block *)
- EOT = $04; (* End of XMODEM transmission *)
- ACK = $06; (* Acknowledge an XMODEM block *)
- NAK = $15; (* Refuse an XMODEM block *)
- SYN = $16; (* Start of Telink header *)
- CAN = $18; (* Cancel XMODEM transfer *)
-
- CONST
- MaxSectorLength = 5000 (* Length of sector data storage *);
- MaxFileHandleBuffer = 2048 (* Length of file handle buffer *);
-
- TYPE
- Sector_Type = ARRAY[ 1 .. MaxSectorLength ] OF BYTE;
- File_Handle_Buffer_Type = ARRAY[ 1 .. MaxFileHandleBuffer ] OF BYTE;
- File_Handle_Buffer_Ptr = ^File_Handle_Buffer_Type;
-
- VAR
- Sector_Size : INTEGER (* Size of Xmodem sector *);
-
- (* One sector of data *)
- Sector_Data : Sector_Type;
-
- Sector_Number : INTEGER (* Current sector number being sent *);
-
- Max_Write_Buffer : INTEGER (* File transfer buffer size *);
-
-
- (* Transfer Declarations *)
- TYPE
- Transfer_Type = ( Ascii, Xmodem_Chk, Xmodem_CRC, Kermit, Telink,
- Modem7_Chk, Modem7_CRC, Xmodem_1K, Xmodem_1KG,
- Ymodem_Batch, Ymodem_G, Zmodem, WXModem, Rlink,
- SeaLink, YTerm, PUser1, PUser2, PUser3, PUser4,
- PUser5, None );
-
- CONST
- Max_Transfer_Types = 22;
-
- VAR (* Vector of available transfer types *)
-
- Transfers : ARRAY[ 1 .. Max_Transfer_Types ] OF Transfer_Type;
-
- (* Vector of long transfer type names *)
-
- Transfer_Name_List : ARRAY[ 1 .. Max_Transfer_Types ] OF String12;
-
- (* Vector of short transfer type names *)
-
- Trans_Type_Name : ARRAY[ Transfer_Type ] OF Char_2;
-
- (* If protocol OK for use in host mode *)
-
- Trans_OK_In_Host : ARRAY[ Transfer_Type ] OF BOOLEAN;
-
- (* Non-batch protocols *)
-
- Single_File_Protocol : ARRAY[Transfer_Type] OF BOOLEAN;
-
- (* Script names for external handlers *)
-
- Receive_Script_Names : ARRAY[ Transfer_Type ] OF String12;
- Send_Script_Names : ARRAY[ Transfer_Type ] OF String12;
-
- (* File for Xmodem family transfers *)
- VAR
- XFile_Handle : INTEGER (* Xmodem File uploaded/downloaded *);
- FileName : AnyStr (* Name of file *);
- Saved_Kbd_File_Name : AnyStr (* Saved keyboard line with filename *);
-
- (* Timing/Delay Constants and Variables *)
- CONST
- One_Second = 1 (* One second *);
- Two_Seconds = 2 (* Two seconds *);
- Five_Seconds = 5 (* Five seconds *);
- Ten_Seconds = 10 (* Ten seconds *);
- Twenty_Seconds = 20 (* Twenty seconds *);
- Sixty_Seconds = 60 (* Sixty seconds *);
- Trans_Time_Val = 1800.0 (* Fudge factor for transfer times *);
-
- VAR
- Ascii_Char_Delay : INTEGER (* Character delay for Ascii trans. *);
- Ascii_Line_Delay : INTEGER (* Line delay for Ascii transfers *);
- Ascii_CR_LF_String: STRING[2] (* CR or CR+LF to end ASCII lines *);
- Ascii_Line_Size : INTEGER (* Line size for stream transfers *);
-
- (* Save/restore transmission params during XMODEM *)
-
- VAR
- Xmodem_Bits_Save : INTEGER (* Save # bits per character *);
- Xmodem_Parity_Save: CHAR (* Save parity *);
- Xmodem_Stop_Save : INTEGER (* Save stop bits *);
-
- VAR
- Xmodem_Char_Wait : INTEGER (* Character wait for Xmodem trans. *);
- Xmodem_Block_Wait : INTEGER (* Interblock wait for Xmodem trans. *);
- Xmodem_Ack_Wait : INTEGER (* ACK wait time for Xmodem trans. *);
- Xmodem_Max_Errors : INTEGER (* Maximum errors in Xmodem *);
-
- VAR (* Default transfer type *)
- Default_Transfer_Type : Transfer_Type;
-
- VAR
- Stop_Receive : BOOLEAN (* TRUE to cancel receiving of file. *);
- Stop_Send : BOOLEAN (* TRUE to cancel sending of file. *);
- Use_Time_Sent : BOOLEAN (* TRUE to stamp file with received *)
- (* time and date. *);
- Null_File_Name : BOOLEAN (* TRUE if null file name in Ymodem *);
- Ascii_Use_CtrlZ : BOOLEAN (* TRUE if CtrlZ used as EOF marker *);
- Ascii_Show_Text : BOOLEAN (* TRUE to display text during trans.*);
- Ascii_Send_Blank: BOOLEAN (* TRUE to send empty lines as blank *);
- Ascii_Send_Asis : BOOLEAN (* TRUE to send text as is *);
- Display_Status : BOOLEAN (* TRUE to display transfer status *);
- Ascii_Translate : BOOLEAN (* TRUE to use translate tab in down.*);
- Ascii_Pacing_Char : CHAR (* Pacing character for uploads *);
- Downsize_Ymodem : BOOLEAN (* TRUE to allow downsize in Ymodem *);
- Script_Transfer : BOOLEAN (* TRUE if doing transfer in script *);
- GMT_Difference : INTEGER (* Difference in hours between local *)
- (* time and Greenwich mean time *);
- Transfer_Bells : INTEGER (* Number of bells after transfer *);
- YTerm_Mode : CHAR (* YTERM transfer mode *);
- Do_WXModem : BOOLEAN (* TRUE to do WXModem *);
- Do_SeaLink : BOOLEAN (* TRUE to do SeaLink *);
- Zmodem_BlockSize: INTEGER (* Length for Zmodem transfers *);
-